How to modify and commit changes to a docker image   2018-07-27


Customize image is the must if we’re using other’s docker image.

Something like install new packages, drivers, plugins of application, or setting global variables, etc.

so guide below is how you manipulate the docker image

Run image file as a container

sudo docker run --name CONTAINER_NAME -p PORT:PORT -e TERM=xterm -d <DOCKER_IMAGE>

Use command in container environment

sudo docker exec -it <CONTAINER_ID> bash

Install packages you need

apt install <package>
pip install <python-package>

Commit change and save to new image

sudo docker commit <CONTAINER_ID> superset-mssql

Check image

sudo docker images

Contents

  1. Run image file as a container
  2. Use command in container environment
  3. Install packages you need
  4. Commit change and save to new image
  5. Check image